package com.linjing.item.service;

import com.linjing.item.model.ItemBo;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Value;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author 仇冬林
 * @date 2022/5/9
 */

@Slf4j
@DubboService(group = "simple")
public class ItemServiceSimpleImpl implements ItemService{

    InetAddress inetAddress;

    @Value("${server.port}")
    private String port;
    public ItemServiceSimpleImpl() throws UnknownHostException {
        inetAddress = InetAddress.getLocalHost();
    }

    @Override
    public String addItem(ItemBo itemBo) {
        return "simple ok, from: " + inetAddress.getHostAddress() + ", port" + port;
    }
}
